package com.javalab._7thread._2Operate._3Join;

/**
 * join的作用是让主线程等待子线程结束才继续执行
 */
public class Test {
    public static void main(String[] args) throws InterruptedException {
        JoinThread joinThread = new JoinThread();
        Thread thread = new Thread(joinThread);
        thread.start();

        System.out.println("等待子线程...");
        // 停在这里，等待子线程完成
        thread.join();
        System.out.println("主线程结束");
    }
}
